home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Headers / misckit / MiscStringArray.h < prev    next >
Encoding:
Text File  |  1994-12-10  |  1.8 KB  |  67 lines

  1. //
  2. //    MiscStringArray.h -- a generic class to store lists of strings
  3. //        Originally written by Drew Davidson
  4. //        Copyright (c) 1994 by Drew Davidson.
  5. //        Modified and extended by Don Yacktman for inclusion into the MiscKit.
  6. //                Version 1.4.  All rights reserved.
  7. //        This notice may not be removed from this source code.
  8. //
  9. //    This object is included in the MiscKit by permission from the author
  10. //    and its use is governed by the MiscKit license, found in the file
  11. //    "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  12. //    for a list of all applicable permissions and restrictions.
  13. //    
  14.  
  15. /*----------------------------------------------------------------------------
  16.     $Source$
  17.  
  18.     REVISIONS
  19.     $Log$
  20. ----------------------------------------------------------------------------*/
  21. # import <objc/Object.h>
  22.  
  23. @class List;
  24.  
  25. # define MISC_NOT_IN_ARRAY        0xffffffff
  26.  
  27. @interface MiscStringArray : Object
  28. {    /*
  29.      * Other instance variables
  30.      */
  31.     List            *strings;
  32.     const char        **stringArray;
  33.     BOOL            uniqued;
  34. }
  35.  
  36. + initialize;
  37.  
  38. - (BOOL)uniqued;
  39. - setUniqued:(BOOL)yn;
  40.  
  41. - strings;
  42. - addString:(const char *)aString;
  43. - removeString:(const char *)aString;
  44. - insertString:(const char *)aString at:(unsigned int)index;
  45.  
  46. /* add aStringObj to the array -- note that the array takes OWNERSHIP
  47.    of aStringObj and WILL FREE IT when emptied or freed!!!
  48.  */
  49. - addStringObject:(MiscString *) aStringObj; // -bbum
  50.  
  51. - (unsigned int)stringCount;
  52. - (unsigned int)count;    // same thing as above
  53. - (const char **)stringArray;
  54. - (const char *)stringAt:(unsigned int)index;
  55. - (unsigned int)indexOfString:(const char *)aString;
  56. - empty; // -bbum
  57. - sort; // -bbum
  58.  
  59. // AppKit support
  60.  
  61. // Browser delegate code from Steve Hayman, taken from code by Jeff Martin
  62. - (int)browser:sender fillMatrix:matrix inColumn:(int)column;
  63. - read:(NXTypedStream *)stream;
  64. - write:(NXTypedStream *)stream;
  65.  
  66. @end
  67.